/**
 * Licensee: Hochschule Heilbronn
 * License Type: Academic
 */
package ormsamples;

import org.orm.*;

public class ListLNdMData {
	private static final int ROW_COUNT = 100;

	public void listTestData() throws PersistentException {
		System.out.println("Listing Station...");
		de.hhn.pmt.tour.u6.Station[] dehhnpmttouru6Stations = de.hhn.pmt.tour.u6.StationDAO
				.listStationByQuery(null, null);
		int length = Math.min(dehhnpmttouru6Stations.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(dehhnpmttouru6Stations[i]);
		}
		System.out.println(length + " record(s) retrieved.");

		System.out.println("Listing Tour...");
		de.hhn.pmt.tour.u6.Tour[] dehhnpmttouru6Tours = de.hhn.pmt.tour.u6.TourDAO
				.listTourByQuery(null, null);
		length = Math.min(dehhnpmttouru6Tours.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(dehhnpmttouru6Tours[i]);
		}
		System.out.println(length + " record(s) retrieved.");

		System.out.println("Listing RegistrierterBenutzer...");
		de.hhn.pmt.tour.u6.RegistrierterBenutzer[] dehhnpmttouru6RegistrierterBenutzers = de.hhn.pmt.tour.u6.RegistrierterBenutzerDAO
				.listRegistrierterBenutzerByQuery(null, null);
		length = Math.min(dehhnpmttouru6RegistrierterBenutzers.length,
				ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(dehhnpmttouru6RegistrierterBenutzers[i]);
		}
		System.out.println(length + " record(s) retrieved.");

		System.out.println("Listing Veranstalter...");
		de.hhn.pmt.tour.u6.Veranstalter[] dehhnpmttouru6Veranstalters = de.hhn.pmt.tour.u6.VeranstalterDAO
				.listVeranstalterByQuery(null, null);
		length = Math.min(dehhnpmttouru6Veranstalters.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(dehhnpmttouru6Veranstalters[i]);
		}
		System.out.println(length + " record(s) retrieved.");

		System.out.println("Listing Location...");
		de.hhn.pmt.tour.u6.Location[] dehhnpmttouru6Locations = de.hhn.pmt.tour.u6.LocationDAO
				.listLocationByQuery(null, null);
		length = Math.min(dehhnpmttouru6Locations.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(dehhnpmttouru6Locations[i]);
		}
		System.out.println(length + " record(s) retrieved.");

		System.out.println("Listing Event...");
		de.hhn.pmt.tour.u6.Event[] dehhnpmttouru6Events = de.hhn.pmt.tour.u6.EventDAO
				.listEventByQuery(null, null);
		length = Math.min(dehhnpmttouru6Events.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(dehhnpmttouru6Events[i]);
		}
		System.out.println(length + " record(s) retrieved.");

		System.out.println("Listing Organisator...");
		de.hhn.pmt.tour.u6.Organisator[] dehhnpmttouru6Organisators = de.hhn.pmt.tour.u6.OrganisatorDAO
				.listOrganisatorByQuery(null, null);
		length = Math.min(dehhnpmttouru6Organisators.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(dehhnpmttouru6Organisators[i]);
		}
		System.out.println(length + " record(s) retrieved.");

		System.out.println("Listing Coordinates...");
		de.hhn.pmt.tour.u6.Coordinates[] dehhnpmttouru6Coordinateses = de.hhn.pmt.tour.u6.CoordinatesDAO
				.listCoordinatesByQuery(null, null);
		length = Math.min(dehhnpmttouru6Coordinateses.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(dehhnpmttouru6Coordinateses[i]);
		}
		System.out.println(length + " record(s) retrieved.");

	}

	public static void main(String[] args) {
		try {
			ListLNdMData listLNdMData = new ListLNdMData();
			try {
				listLNdMData.listTestData();
			} finally {
				de.hhn.pmt.tour.u6.LNdMPersistentManager.instance()
						.disposePersistentManager();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
